<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Update Test Details</title>
</head>
<body>
<div><s:actionerror /></div>
<s:form method="post">
<br>
<br>
<br>
<table align="center">
<!-- 
	<col width="20" />
	<col width="50" />
	<col width="70" />
	<col width="5" />
	<col width="10" />
	<col width="5"/>
	 -->
	<thead>
		<tr>
			<th>Select&nbsp;</th>
			<th>TestId&nbsp;</th>
			<th>TestName&nbsp;&nbsp;</th>
			<th>TestDescription&nbsp;&nbsp;</th>
			<th>TotalQuestions&nbsp;</th>
			<th>Disable&nbsp;</th>
			<th>Duration (min)</th>
		</tr>		
	</thead>
	<tbody>
	<s:iterator value="testDetails" status="stat" var="eachTest">
	<!-- 
	 	<tr class="<s:if test="#stat.odd == true">oddRow</s:if><s:else>evenRow</s:else>">
	  -->
	  		<tr>
	 		<td><s:checkbox name="selectedRows['%{#eachTest.testId}']" fieldValue="true" value="selectedRows['%{#eachTest.testId}']" theme="simple"></s:checkbox></td>
			<td><s:property value="%{#eachTest.testId}"/> <s:hidden name="testDetails[%{#stat.count-1}].testId"/></td>
			<td><s:textfield name="testDetails[%{#stat.count-1}].testName" value="%{#eachTest.testName}" size="10" theme="simple"/></td>
			<td><s:textfield name="testDetails[%{#stat.count-1}].testDescription" value="%{#eachTest.testDescription}" size="20" theme="simple"/></td>
			<td><s:textfield name="testDetails[%{#stat.count-1}].totalNumberOfQuesions" value="%{#eachTest.totalNumberOfQuesions}" size="5" theme="simple"/></td>
			<td><s:textfield name="testDetails[%{#stat.count-1}].disabled" value="%{#eachTest.disabled}" theme="simple" size="10"/></td>
			<td><s:textfield name="testDetails[%{#stat.count-1}].duration" value="%{#eachTest.duration}" theme="simple" size="5"/></td>
		</tr>
	</s:iterator>
		
		 
		 
	</tbody>	
</table>
<div align="center">
<s:submit value="Update Selected Rows" name="button" action="updateTestDetails" align="center" theme="simple" namespace="/" />
</div>
<br/>
<s:url value="Admin.jsp" var="admin" />
<s:a href="%{admin}" >Back to Admin Page</s:a>
<br>

</s:form>
</body>
</html>